# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=rp
pkgver=170.0b39cac
pkgrel=1
groups=('blackarch' 'blackarch-exploitation' 'blackarch-binary')
pkgdesc='A full-cpp written tool that aims to find ROP sequences in PE/Elf/Mach-O x86/x64 binaries.'
arch=('x86_64' 'aarch64')
url='https://github.com/0vercl0k/rp'
license=('GPL3')
makedepends=('git' 'cmake')
source=("git+https://github.com/0vercl0k/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  mkdir -p build

  cd build

  cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr ..

  make
}

package() {
  cd $pkgname

  install -Dm 755 -t "$pkgdir/usr/bin/" bin/rp-*
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md TODO
  install -Dm 644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}

